//           https://www.nowcoder.com/questionTerminal/cd117803b3364b218a8b3dcc498dee25?page=1&onlyReference=false



#include <iostream>

using namespace std;

int main()
{
    int q;
    int a, b, c;
    int res1, res2, res;
    cin >> q;
    while (q--)
    {
        scanf("%d %d %d", &a, &b, &c);
        int k = min(min(a, b), c);
        res1 = 2 * k;
        res2 = max(b - k - 1, 0);
        res = res1 + res2;
        printf("%d\n", res);
    }

    return 0;
}